An electronic camera such as a digital camera incorporates a solid state imaging device for photoelectrically converting subject light into an electric signal. The solid state imaging device includes a solid state imaging element such as a charge-coupled device (CCD) and a complementary metal-oxide semiconductor (CMOS), a package for housing the solid state imaging element (bare chip), and a cover glass attached to the package for covering an imaging surface of the solid state imaging element.
When the cover glass has defects such as stain, scratch, and incorporation of foreign materials, a part of the subject light is scattered or blocked by these defects, and not able to enter the imaging surface of the solid state imaging element. Therefore, before the solid state imaging device is mounted to the electric camera, the cover glass thereof is subjected to defect inspection. In the defect inspection, in general, while light is applied to the cover glass, the cover glass is captured (imaged) by a camera, and based on the captured image of the cover glass, defects are detected (see Japanese Patent Laid-Open Publication No. 2002-139454).
When the cover glass is captured by the camera in the defect inspection, at first, a focal length of the camera is adjusted, and then a front side surface of the cover glass is focused and captured. Next, a rear side surface of the cover glass is focused and captured in the same manner. Thereby, based on an image of the front side surface of the cover glass (hereinafter referred to as front side image) and an image of the rear side surface thereof (hereinafter referred to as rear side image), the defects of the cover glass are detected.
However, when the front and rear side surfaces of the cover glass are focused and captured respectively, if the depth of field is shallow, the following problems may occur. For example, in a case where a minute scratch or the like which is not considered as a defect in the defect inspection (hereinafter, referred to as “allowable defect”) is caused on the front side surface of the cover glass, and the rear side surface of the cover glass is focused and captured, the allowable defect appears as a blurred image on the rear side image. When the blurred image caused by the allowable defect is judged as a defect, even though the cover glass should be judged as a non-defective product in a normal case, the cover glass is sometimes considered as a defective product. As a result, unnecessary inspection is performed, and thereby the productivity is decreased.